'''
''' Performs the custom redirect after successful login
'''
Protected Overrides Sub RedirectOnSuccess()
If (Not String.IsNullOrEmpty(Me.SuccessURL)) Then
Me.Page.Response.Redirect(Me.SuccessURL)
Else
Dim role As String = BaseClasses.Utils.SecurityControls.GetCurrentUserRoles()
' GetCurrentUserRoles() will return semi-colon-delimited list of RoleIDsvalues such as {RoleID1;RoleID2}.
' Note, that for ActiveDirectory Security roles names are effectively roles IDs. Also note, that
' Active Directory and Azman roles can include domain name such as "MyDomain\RoleName".
If role = "" Then
CType(Me.Page, BaseApplicationPage).RedirectBack(False)
End If
Dim separator As Char() = {";"c}
Dim roles As String() = role.Split(separator, System.StringSplitOptions.RemoveEmptyEntries)
Dim includes As Boolean = False
For Each r As String In roles
If r = "2" Then
includes = True
End If
Next r
If includes Then
Me.Page.Response.Redirect("../TableName/ShowTableNameTable.aspx")
Else
CType(Me.Page, BaseApplicationPage).RedirectBack(False)
End If
End If
End Sub
|